package org.mseco.doc.expensetrack.util;

import org.mseco.doc.expensetrack.R;

import android.content.Context;
import android.util.TypedValue;
import android.widget.AbsListView;
import android.widget.TableRow.LayoutParams;
import android.widget.TextView;

public class LayoutUtil {

	public static void setupTextViewinRow(TextView textView, Context context, int gravity){
		LayoutParams layoutParams = new LayoutParams(LayoutParams.FILL_PARENT,
                LayoutParams.WRAP_CONTENT,1f);
//		layoutParams.gravity=gravity;
		textView.setLayoutParams(layoutParams);
		
		textView.setPadding(2, 2, 2, 2);
		textView.setBackgroundResource(R.drawable.cellshape);		
		textView.setTextSize(TypedValue.COMPLEX_UNIT_SP,context.getResources().getDimension(R.dimen.font_size));
		textView.setHeight((int)context.getResources().getDimension(R.dimen.textview_height));

	}
	
	public static void setupTextViewinList(TextView textView, Context context, int gravity){
		AbsListView.LayoutParams layoutParams = new AbsListView.LayoutParams(AbsListView.LayoutParams.FILL_PARENT,
				AbsListView.LayoutParams.WRAP_CONTENT);
//		layoutParams.gravity=gravity;
		textView.setLayoutParams(layoutParams);
		
		textView.setPadding(2, 2, 2, 2);
		textView.setBackgroundResource(R.drawable.cellshape);		
		textView.setTextSize(TypedValue.COMPLEX_UNIT_SP,context.getResources().getDimension(R.dimen.font_size));
		textView.setHeight((int)context.getResources().getDimension(R.dimen.textview_height));

		
	}
}
